home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_xemacs.idb / usr / freeware / lib / xemacs-20.4 / lisp / prim / advocacy.el.z / advocacy.el
Encoding:
Text File  |  1998-05-21  |  2.8 KB  |  87 lines

  1. ;;; advocacy.el -- blatant XEmacs self promotion
  2. ;; Copyright (C) 1996 Miranova Systems, Inc.
  3. ;; Copyright (C) 1996 Chuck Thompson <cthomp@xemacs.org>
  4.  
  5. ;; Original Author:  Steve L Baur <steve@miranova.com>
  6.  
  7. ;; This file is part of XEmacs.
  8.  
  9. ;; XEmacs is free software; you can redistribute it and/or modify it
  10. ;; under the terms of the GNU General Public License as published by
  11. ;; the Free Software Foundation; either version 2, or (at your option)
  12. ;; any later version.
  13.  
  14. ;; XEmacs is distributed in the hope that it will be useful, but
  15. ;; WITHOUT ANY WARRANTY; without even the implied warranty of
  16. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  17. ;; General Public License for more details.
  18.  
  19. ;; You should have received a copy of the GNU General Public License
  20. ;; along with XEmacs; see the file COPYING.  If not, write to the 
  21. ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  22. ;; Boston, MA 02111-1307, USA.
  23.  
  24. ;;;###autoload
  25. (defvar xemacs-praise-sound-file "sounds/im_so_happy.au"
  26.   "The name of an audio file containing something to play
  27. when praising XEmacs")
  28.  
  29. ;;;###autoload
  30. (defvar xemacs-praise-message
  31.   "All Hail XEmacs!\n"
  32.   "What to praise XEmacs with")
  33.  
  34. ;;;###autoload
  35. (defun praise-be-unto-xemacs (&optional arg)
  36.   "All Hail XEmacs!"
  37.   (interactive "_p")
  38.   (save-window-excursion
  39.     (let ((count (if (null arg)
  40.              0
  41.            arg))
  42.        (max-faces (length (face-list))))
  43.       (with-output-to-temp-buffer "*Praise*"
  44.     (set-buffer "*Praise*")
  45.         (if (glyphp xemacs-logo)
  46.             (let ((p (point)))
  47.               (insert "\n")
  48.               (indent-to (startup-center-spaces xemacs-logo))
  49.               (set-extent-begin-glyph (make-extent (point) (point)) xemacs-logo)
  50.               (insert "\n\n")))
  51.     (while (> count 0)
  52.       (progn
  53.         (insert-face xemacs-praise-message
  54.              (get-face (nth (random max-faces) (face-list))))
  55.         (setq count (- count 1))))))
  56.     (let ((sound-file
  57.        (or (and (file-exists-p xemacs-praise-sound-file)
  58.             xemacs-praise-sound-file)
  59.            (and (file-exists-p
  60.              (concat data-directory xemacs-praise-sound-file))
  61.             (concat data-directory xemacs-praise-sound-file)))))
  62.       (if (and (device-sound-enabled-p) sound-file)
  63.       (progn
  64.         (sit-for 0)
  65.         (play-sound-file sound-file))
  66.     (sit-for 10)))))
  67.  
  68. ;;;###autoload
  69. (defun praise-be-unto-emacs (&optional arg)
  70.   (interactive "_p")
  71.   (error "Obsolete function.  Use `praise-be-unto-xemacs'."))
  72. (make-compatible 'praise-be-unto-emacs "use praise-be-unto-xemacs")
  73.  
  74. ;;;###autoload
  75. (defun all-hail-xemacs (&optional arg)
  76.   "All Hail XEmacs!"
  77.   (interactive "_p")
  78.   (praise-be-unto-xemacs arg))
  79.  
  80. ;;;###autoload
  81. (defun all-hail-emacs (&optional arg)
  82.   (interactive "_p")
  83.   (error "Obsolete function.  Use `all-hail-xemacs'."))
  84. (make-compatible 'all-hail-emacs "use all-hail-xemacs")
  85.  
  86. ;;; advocacy.el ends here
  87.